/*
 * 文 件    名:  CBModel.java
 * 创建日期:  2012-12-11下午3:55:20
 * 版          权:  Epro Technologies Co., Ltd. Copyright 2011-2012,  All rights reserved
 * 作          者:  yw66009
 */
package com.weipu.common.facade.model;

import java.io.Serializable;

import org.json.JSONObject;

import com.weipu.common.constants.ServerConstant;

/** 
 * @Description 广告类
 * @version [版本号, 2012-12-11]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 * 
 * @author yw66009
 */
public class CBModel implements Serializable
{
    /** 
     * @Fields serialVersionUID : 序列版本号
     */
    private static final long serialVersionUID = 7972608964433106435L;
    
    private String cBId;
    
    private String cBImg;
    
    private String cBName;
    
    public String getCBName()
    {
        return cBName;
    }
    
    public void setCBName(String cBName)
    {
        this.cBName = cBName;
    }
    
    public String getCBId()
    {
        return cBId;
    }
    
    public void setCBId(String cBId)
    {
        this.cBId = cBId;
    }
    
    public String getCBImg()
    {
        return cBImg;
    }
    
    public void setCBImg(String cBImg)
    {
        this.cBImg = cBImg;
    }
    
    public static long getSerialversionuid()
    {
        return serialVersionUID;
    }
    
    public static CBModel json2CBModel(JSONObject json)
    {
        CBModel model = new CBModel();
        if (null != json)
        {
            if (json.optString(ServerConstant.CB.CONSTANT_CBID) != JSONObject.NULL
                && !json.isNull(ServerConstant.CB.CONSTANT_CBID))
            {
                model.setCBId(json.optString(ServerConstant.CB.CONSTANT_CBID));
            }
            if (json.optString(ServerConstant.CB.CONSTANT_CBIMG) != JSONObject.NULL
                && !json.isNull(ServerConstant.CB.CONSTANT_CBIMG))
            {
                model.setCBImg(json.optString(ServerConstant.CB.CONSTANT_CBIMG));
            }
            if (json.optString(ServerConstant.CB.CONSTANT_CBNAME) != JSONObject.NULL
                && !json.isNull(ServerConstant.CB.CONSTANT_CBNAME))
            {
                model.setCBName(json.optString(ServerConstant.CB.CONSTANT_CBNAME));
            }
        }
        
        return model;
    }
    
}
